import request from '@/utils/request'

// 查询采购申请列表
export function listPurchaseApply(query) {
  return request({
    url: '/oa/purchaseApply/list',
    method: 'get',
    params: query
  })
}

// 查询采购申请详细
export function getPurchaseApply(id) {
  return request({
    url: '/oa/purchaseApply/' + id,
    method: 'get'
  })
}

// 新增采购申请
export function addPurchaseApply(data) {
  return request({
    url: '/oa/purchaseApply',
    method: 'post',
    data: data
  })
}

// 修改采购申请
export function updatePurchaseApply(data) {
  return request({
    url: '/oa/purchaseApply',
    method: 'put',
    data: data
  })
}

// 删除采购申请
export function delPurchaseApply(id) {
  return request({
    url: '/oa/purchaseApply/' + id,
    method: 'delete'
  })
}

// 获取没有采购流程的项目信息
export function getProjectList() {
  return request({
    url: '/oa/purchaseApply/getProjectList',
    method: 'get'
  })
}

// 通过项目名称查询采购申请
export function queryPurchaseApplyByProjectName(data) {
  return request({
    url: '/oa/purchaseApply/queryByProjectName',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data,
  })
}
